package com.healthdata.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.healthdata.entity.HospitalBedSize;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface HospitalBedSizeRepository extends BaseMapper<HospitalBedSize> {
    @Select("<script>" +
            "SELECT * FROM hospital_by_bed_size WHERE name IN " +
            "<foreach item='item' index='index' collection='names' open='(' separator=',' close=')'>" +
            "#{item}" +
            "</foreach>" +
            "</script>")
    List<HospitalBedSize> findByNameIn(@Param("names") List<String> names);
}
